﻿<controls:ChildWindow x:Class="Skynet.SLAdministration.Views.MgmCategories.CreateCategoryView"           
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:df="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
           Width="400" Height="300" 
           Title="CreateCategoryView" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" Closed="ChildWindow_Closed">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>        
        <df:DataForm  Name="dfCategory" AutoGenerateFields="False"
                      AutoEdit="False"
                      AutoCommit="False"
                      ItemsSource="{Binding DomainContext.ExamCategories, Converter={StaticResource EntityListDataFormConverter}}"                      
                      CurrentItem="{Binding WorkCategory, Mode=TwoWay}"                       
                      CommandButtonsVisibility="All" EditEnded="dfCategory_EditEnded">
            <df:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <df:DataField  Label="Title"  >
                            <TextBox Text="{Binding Title, Mode=TwoWay}"></TextBox>
                        </df:DataField>
                        <df:DataField  Label="Description"  >
                            <TextBox Text="{Binding Description, Mode=TwoWay}"></TextBox>
                        </df:DataField>
                    </StackPanel>
                </DataTemplate>
            </df:DataForm.EditTemplate>            
        </df:DataForm>
    </Grid>
</controls:ChildWindow>